add_library(test_chisquare SHARED test_chisquare.cpp)
add_library(test_dgeom SHARED test_dgeom.cpp)
add_library(test_kd SHARED test_kd.cpp)
add_library(test_la SHARED test_la.cpp)
add_library(test_microfacet SHARED test_microfacet.cpp)
add_library(test_quad SHARED test_quad.cpp)
add_library(test_random SHARED test_random.cpp)
add_library(test_rtrans SHARED test_rtrans.cpp)
add_library(test_samplers SHARED test_samplers.cpp)
add_library(test_sh SHARED test_sh.cpp)
add_library(test_spectrum SHARED test_spectrum.cpp)

target_compile_definitions(test_chisquare PRIVATE MTS_TESTCASE=1)
target_compile_definitions(test_dgeom PRIVATE MTS_TESTCASE=1)
target_compile_definitions(test_kd PRIVATE MTS_TESTCASE=1)
target_compile_definitions(test_la PRIVATE MTS_TESTCASE=1)
target_compile_definitions(test_microfacet PRIVATE MTS_TESTCASE=1)
target_compile_definitions(test_quad PRIVATE MTS_TESTCASE=1)
target_compile_definitions(test_random PRIVATE MTS_TESTCASE=1)
target_compile_definitions(test_rtrans PRIVATE MTS_TESTCASE=1)
target_compile_definitions(test_samplers PRIVATE MTS_TESTCASE=1)
target_compile_definitions(test_sh PRIVATE MTS_TESTCASE=1)
target_compile_definitions(test_spectrum PRIVATE MTS_TESTCASE=1)

target_link_libraries(test_chisquare mitsuba-python)
target_link_libraries(test_dgeom mitsuba-python)
target_link_libraries(test_kd mitsuba-python)
target_link_libraries(test_la mitsuba-python)
target_link_libraries(test_microfacet mitsuba-python)
target_link_libraries(test_quad mitsuba-python)
target_link_libraries(test_random mitsuba-python)
target_link_libraries(test_rtrans mitsuba-python)
target_link_libraries(test_samplers mitsuba-python)
target_link_libraries(test_sh mitsuba-python)
target_link_libraries(test_spectrum mitsuba-python)

set_target_properties(test_chisquare PROPERTIES FOLDER "tests")
set_target_properties(test_dgeom PROPERTIES FOLDER "tests")
set_target_properties(test_kd PROPERTIES FOLDER "tests")
set_target_properties(test_la PROPERTIES FOLDER "tests")
set_target_properties(test_microfacet PROPERTIES FOLDER "tests")
set_target_properties(test_quad PROPERTIES FOLDER "tests")
set_target_properties(test_random PROPERTIES FOLDER "tests")
set_target_properties(test_rtrans PROPERTIES FOLDER "tests")
set_target_properties(test_samplers PROPERTIES FOLDER "tests")
set_target_properties(test_sh PROPERTIES FOLDER "tests")
set_target_properties(test_spectrum PROPERTIES FOLDER "tests")